/* Common Chat Styles - Shared across all chat interfaces */

:root {
	--nl-web-sidebar-width: 260px;
	--nl-web-primary-color: #5e5eff;
	--nl-web-text-primary: #0d0d0d;
	--nl-web-text-secondary: #666;
	--nl-web-bg-primary: #ffffff;
	--nl-web-bg-secondary: #f7f7f8;
	--nl-web-bg-sidebar: #f9f9f9;
	--nl-web-border-color: #e5e5e5;
	--nl-web-hover-bg: #f0f0f0;
	--nl-web-message-user-bg: #f7f7f8;
	--nl-web-message-assistant-bg: #ffffff;
	--nl-web-input-bg: #ffffff;
	--nl-web-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
	--nl-web-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
	--nl-web-transition: all 0.2s ease;
}

/* * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
} */

/* body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    sans-serif;
  background-color: var(--nl-web-bg-primary);
  color: var(--nl-web-text-primary);
} */

/* Scrollbar Styling */
/* ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
} */

/* Sidebar Styles */
.sidebar {
	width: var(--nl-web-sidebar-width);
	background-color: var(--nl-web-bg-sidebar);
	border-right: 1px solid var(--nl-web-border-color);
	display: flex;
	flex-direction: column;
	transition: var(--nl-web-transition);
	position: relative;
	height: 100vh;
}

.sidebar.collapsed {
	width: 0;
	overflow: hidden;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
	position: fixed;
	left: var(--nl-web-sidebar-width);
	top: 20px;
	width: 32px;
	height: 32px;
	background-color: var(--nl-web-bg-primary);
	border: 1px solid var(--nl-web-border-color);
	border-radius: 0 6px 6px 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		left var(--nl-web-transition),
		border-radius var(--nl-web-transition);
	z-index: 10;
	box-shadow: var(--nl-web-shadow-sm);
}

.sidebar-toggle.sidebar-collapsed {
	left: 0;
	border-radius: 0 6px 6px 0;
	box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:hover {
	background-color: var(--nl-web-hover-bg);
	box-shadow: var(--nl-web-shadow-md);
}

.sidebar-toggle svg {
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}

.sidebar-toggle.sidebar-collapsed svg {
	transform: rotate(180deg);
}

.sidebar-header {
	padding: 16px;
	border-bottom: 1px solid var(--nl-web-border-color);
}

/* Conversations List Components */
.conversations-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0;
}

.conversations-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	color: var(--nl-web-text-primary);
}

.new-chat-icon-btn {
	width: 32px;
	height: 32px;
	background-color: transparent;
	border: 1px solid var(--nl-web-border-color);
	border-radius: 6px;
	cursor: pointer;
	transition: var(--nl-web-transition);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.new-chat-icon-btn:hover {
	background-color: var(--nl-web-hover-bg);
	border-color: var(--nl-web-primary-color);
}

.plus-icon {
	font-size: 20px;
	font-weight: bold;
	line-height: 1;
	color: var(--nl-web-text-secondary);
}

.new-chat-icon-btn:hover .plus-icon {
	color: var(--nl-web-primary-color);
}

.conversations-list {
	max-height: 60%;
	overflow-y: auto;
	padding: 8px;
	flex-shrink: 0;
}

/* Conversation Items */
.conversation-item {
	padding: 12px 16px;
	margin-bottom: 2px;
	border-radius: 6px;
	cursor: pointer;
	transition: var(--nl-web-transition);
	font-size: 14px;
	color: var(--nl-web-text-secondary);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.conversation-item:hover {
	background-color: var(--nl-web-hover-bg);
}

.conversation-item.active {
	background-color: var(--nl-web-hover-bg);
	color: var(--nl-web-text-primary);
}

.conversation-title {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.conversation-delete {
	opacity: 0;
	width: 24px;
	height: 24px;
	border: none;
	background: none;
	color: var(--nl-web-text-secondary);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: var(--nl-web-transition);
	flex-shrink: 0;
	font-size: 20px;
	line-height: 1;
	font-weight: 300;
}

.conversation-item:hover .conversation-delete {
	opacity: 0.7;
}

.conversation-delete:hover {
	background-color: rgba(255, 0, 0, 0.1);
	color: #ff4444;
	opacity: 1;
}

/* Site Group Headers */
.site-group-header {
	font-size: 12px;
	color: var(--nl-web-text-secondary);
	font-weight: 600;
	padding: 8px 16px 4px 16px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	transition: var(--nl-web-transition);
	user-select: none;
}

.site-group-header:hover {
	color: var(--nl-web-text-primary);
}

.site-group-header .chevron {
	width: 12px;
	height: 12px;
	transition: transform 0.2s ease;
}

.site-group-header.collapsed .chevron {
	transform: rotate(-90deg);
}

.site-conversations {
	overflow: hidden;
	max-height: 1000px;
	transition: max-height 0.3s ease;
}

.site-conversations.collapsed {
	max-height: 0;
}

.site-conversations .conversation-item {
	padding-left: 32px;
}

/* Remembered Items Section */
#remembered-section {
	flex: 1;
	overflow-y: auto;
	border-top: 1px solid var(--nl-web-border-color);
	padding: 16px;
	min-height: 0;
}

/* Main Chat Area */
.main-content {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.chat-header {
	height: 60px;
	border-bottom: 1px solid var(--nl-web-border-color);
	display: flex;
	align-items: center;
	padding: 0 24px 0 56px;
	background-color: var(--nl-web-bg-primary);
	gap: 16px;
	transition: padding-left var(--nl-web-transition);
}

.sidebar.collapsed ~ .main-content .chat-header {
	padding-left: 56px;
}

.chat-title {
	font-size: 16px;
	font-weight: 600;
}

.chat-site-info {
	font-size: 14px;
	color: var(--nl-web-text-secondary);
	background-color: var(--nl-web-bg-secondary);
	padding: 4px 12px;
	border-radius: 16px;
	font-weight: 500;
	display: none;
}

/* Chat Messages */
.chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 0;
	background-color: var(--nl-web-bg-primary);
}

.messages-container {
	width: 100%;
}

.message {
	margin-bottom: 24px;
}

.message-avatar {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 600;
}

.user-message .message-avatar {
	background-color: var(--nl-web-primary-color);
	color: white;
}

.assistant-message .message-avatar {
	background-color: var(--nl-web-bg-secondary);
	color: var(--nl-web-text-primary);
}

.message-content {
	flex: 1;
}

.message-text {
	line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
}

/* Debug Info */
.message-debug-icon {
	margin-left: 12px;
	padding: 4px 8px;
	background-color: var(--nl-web-bg-secondary);
	border: 1px solid var(--nl-web-border-color);
	border-radius: 4px;
	font-family: monospace;
	font-size: 14px;
	font-weight: bold;
	cursor: pointer;
	transition: var(--nl-web-transition);
	display: none;
}

.message-debug-icon:hover {
	background-color: var(--nl-web-primary-color);
	color: white;
	border-color: var(--nl-web-primary-color);
}

.debug-info {
	background-color: #f0f0f0;
	padding: 16px;
	margin: 12px 0;
	border-radius: 8px;
	font-family: monospace;
	font-size: 13px;
	white-space: pre-wrap;
	overflow-x: auto;
}

/* Loading Animation */
.loading-dots {
	display: inline-flex;
	gap: 4px;
}

.loading-dot {
	width: 8px;
	height: 8px;
	background-color: var(--nl-web-text-secondary);
	border-radius: 50%;
	animation: loading 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
	animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes loading {
	0%,
	80%,
	100% {
		transform: scale(0);
	}
	40% {
		transform: scale(1);
	}
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
	display: none;
	position: fixed;
	top: 16px;
	left: 16px;
	z-index: 1000;
	background-color: var(--nl-web-bg-primary);
	border: 1px solid var(--nl-web-border-color);
	border-radius: 8px;
	padding: 8px;
	cursor: pointer;
	box-shadow: var(--nl-web-shadow-md);
}

/* Item Container Styles (for search results) */
.item-container {
	background-color: #ffffff;
	border: 1px solid #f0f0f0;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 12px;
	display: flex;
	gap: 16px;
	width: 100%;
}

.item-content {
	flex: 1;
}

.item-title-row {
	margin-bottom: 8px;
}

.item-title-link {
	color: #0066cc;
	text-decoration: none;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
}

.item-title-link:hover {
	text-decoration: underline;
}

.item-site-link {
	display: inline-block;
	margin-top: 4px;
	color: #5a6c7d;
	text-decoration: none;
	font-size: 13px;
}

.item-site-link:hover {
	text-decoration: underline;
}

.item-description {
	color: var(--nl-web-text-secondary);
	font-size: 14px;
	line-height: 1.5;
	margin: 8px 0;
}

.item-details-text {
	display: inline-block;
	margin: 4px 0;
	padding: 4px 8px;
	background-color: #e9ecef;
	border-radius: 4px;
	font-size: 13px;
	color: #495057;
}

.item-explanation {
	font-style: italic;
	color: #666;
	margin-top: 8px;
	font-size: 14px;
}

.item-image {
	max-width: 120px;
	height: auto;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
	.sidebar {
		position: fixed;
		left: -var(--nl-web-sidebar-width);
		z-index: 999;
		height: 100vh;
		box-shadow: var(--nl-web-shadow-md);
	}

	.sidebar.open {
		left: 0;
	}

	.sidebar.collapsed {
		left: -var(--nl-web-sidebar-width);
	}

	.sidebar-toggle {
		display: none;
	}

	.mobile-menu-toggle {
		display: block;
	}

	.chat-header {
		padding-left: 60px;
	}
}

/* Site selector dropdown */
.site-dropdown {
	position: absolute;
	left: 0;
	background-color: var(--nl-web-bg-primary);
	border: 1px solid var(--nl-web-border-color);
	border-radius: 8px;
	box-shadow: var(--nl-web-shadow-md);
	padding: 8px;
	min-width: 200px;
	max-height: 300px;
	overflow-y: auto;
	display: none;
	z-index: 10;
}

/* Position below in centered input, above in regular input */
.centered-input-container .site-dropdown {
	top: 100%;
	margin-top: 8px;
}

.chat-input-container .site-dropdown {
	bottom: 100%;
	margin-bottom: 8px;
}

.site-dropdown.show {
	display: block;
}

.site-dropdown-item {
	padding: 8px 12px;
	border-radius: 6px;
	cursor: pointer;
	transition: var(--nl-web-transition);
	font-size: 14px;
}

.site-dropdown-item:hover {
	background-color: var(--nl-web-hover-bg);
}

.site-dropdown-item.selected {
	background-color: var(--nl-web-primary-color);
	color: white;
}

.site-dropdown-header {
	font-size: 12px;
	color: var(--nl-web-text-secondary);
	padding: 4px 12px;
	font-weight: 600;
}

/* Mode selector - positioned at bottom */
.input-site-selector {
	position: relative;
	margin-right: 8px;
	display: none;
}

.site-selector-icon {
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 6px;
	background-color: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--nl-web-transition);
}

.site-selector-icon:hover {
	background-color: var(--nl-web-hover-bg);
}

.site-selector-icon svg {
	width: 16px;
	height: 16px;
	color: var(--nl-web-text-secondary);
}

.input-mode-selector {
	position: relative;
	margin-right: 8px;
}

.mode-selector-icon {
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 6px;
	background-color: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--nl-web-transition);
}

.mode-selector-icon:hover {
	background-color: var(--nl-web-hover-bg);
}

.mode-selector-icon svg {
	width: 16px;
	height: 16px;
	color: var(--nl-web-text-secondary);
}

.mode-dropdown {
	position: absolute;
	left: 0;
	background-color: var(--nl-web-bg-primary);
	border: 1px solid var(--nl-web-border-color);
	border-radius: 8px;
	box-shadow: var(--nl-web-shadow-md);
	padding: 8px;
	min-width: 150px;
	display: none;
	z-index: 10;
}

/* Position below in centered input, above in regular input */
.centered-input-container .mode-dropdown {
	top: 100%;
	margin-top: 8px;
}

.chat-input-container .mode-dropdown {
	bottom: 100%;
	margin-bottom: 8px;
}

.mode-dropdown.show {
	display: block;
}

.mode-dropdown-header {
	padding: 8px 12px;
	font-weight: 600;
	font-size: 13px;
	color: var(--nl-web-text-secondary);
	border-bottom: 1px solid var(--nl-web-border-color);
	margin-bottom: 4px;
}

.mode-dropdown-item {
	padding: 8px 12px;
	border-radius: 6px;
	cursor: pointer;
	transition: var(--nl-web-transition);
	font-size: 14px;
}

.mode-dropdown-item:hover {
	background-color: var(--nl-web-hover-bg);
}

.mode-dropdown-item.selected {
	background-color: var(--nl-web-primary-color);
	color: white;
}
.mode-dropdown-item[data-mode="generate"] {
	display: none;
}
/* Messages container with max-width */
.messages-container {
	max-width: 800px;
	margin: 0 auto;
	width: 100%;
	padding: 24px;
}

.message {
	display: flex;
	gap: 16px;
}

.message-content {
	padding-top: 4px;
}

/* Input Area */
.chat-input-container {
	border-top: 1px solid var(--nl-web-border-color);
	background-color: var(--nl-web-bg-primary);
	padding: 16px 0;
}

.chat-input-wrapper {
	max-width: 800px;
	margin: 0 auto;
	padding: 0 24px;
}

.chat-input-box {
	background-color: var(--nl-web-bg-secondary);
	border: 1px solid var(--nl-web-border-color);
	border-radius: 12px;
	padding: 12px 16px;
	display: flex;
	align-items: flex-end;
	gap: 12px;
	box-shadow: var(--nl-web-shadow-sm);
	transition: var(--nl-web-transition);
}

.chat-input-box:focus-within {
	border-color: var(--nl-web-primary-color);
	box-shadow: 0 0 0 3px rgba(94, 94, 255, 0.1);
}

.chat-input {
	flex: 1;
	border: none;
	background: transparent;
	font-size: 15px;
	line-height: 1.5;
	resize: none;
	outline: none;
	max-height: 200px;
	overflow-y: auto;
	font-family: inherit;
}

.chat-input::placeholder {
	color: #999;
}

.send-button {
	background-color: transparent;
	color: var(--nl-web-text-secondary);
	border: none;
	border-radius: 6px;
	padding: 6px;
	cursor: pointer;
	transition: var(--nl-web-transition);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
}

.send-button:hover {
	background-color: var(--nl-web-hover-bg);
	color: var(--nl-web-text-primary);
}

.send-button:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.send-button svg {
	width: 18px;
	height: 18px;
}

/* Search Results Styling */
.search-results {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--nl-web-border-color);
}

.search-result-item {
	margin-bottom: 16px;
	padding: 12px;
	background-color: var(--nl-web-bg-secondary);
	border-radius: 8px;
	transition: var(--nl-web-transition);
}

.search-result-item:hover {
	background-color: var(--nl-web-hover-bg);
}

.result-title {
	color: var(--nl-web-primary-color);
	text-decoration: none;
	font-weight: 500;
	font-size: 16px;
	display: block;
	margin-bottom: 4px;
}

.result-title:hover {
	text-decoration: underline;
}

.result-description {
	color: var(--nl-web-text-secondary);
	font-size: 14px;
	line-height: 1.4;
}

/* Centered Input Styles */
.centered-input-container {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	padding: 24px;
}

/* Input box row styles for centered input */
.input-box-top-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.input-box-bottom-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.centered-input-wrapper {
	width: 100%;
	max-width: 800px;
}

.site-selector-wrapper {
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.site-selector-wrapper label {
	font-size: 14px;
	color: var(--nl-web-text-secondary);
	font-weight: 500;
}

.site-select {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid var(--nl-web-border-color);
	border-radius: 8px;
	font-size: 14px;
	background-color: var(--nl-web-bg-primary);
	color: var(--nl-web-text-primary);
	cursor: pointer;
	transition: var(--nl-web-transition);
}

.site-select:hover {
	border-color: var(--nl-web-primary-color);
}

.site-select:focus {
	outline: none;
	border-color: var(--nl-web-primary-color);
	box-shadow: 0 0 0 3px rgba(94, 94, 255, 0.1);
}

.centered-input-box {
	background-color: var(--nl-web-bg-secondary);
	border: 1px solid var(--nl-web-border-color);
	border-radius: 12px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 0;
	box-shadow: var(--nl-web-shadow-md);
	transition: var(--nl-web-transition);
}

.centered-input-box:focus-within {
	border-color: var(--nl-web-primary-color);
	box-shadow:
		0 0 0 3px rgba(94, 94, 255, 0.1),
		var(--nl-web-shadow-md);
}

.centered-chat-input {
	flex: 1;
	border: none;
	background: transparent;
	font-size: 18px;
	line-height: 1.6;
	resize: none;
	outline: none;
	min-height: 60px;
	max-height: 200px;
	overflow-y: auto;
	font-family: inherit;
	padding: 4px 0;
}

.centered-chat-input::placeholder {
	color: #999;
}

.centered-send-button {
	background-color: transparent;
	color: var(--nl-web-text-secondary);
	border: none;
	border-radius: 6px;
	padding: 6px;
	cursor: pointer;
	transition: var(--nl-web-transition);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
}

.centered-send-button:hover {
	background-color: var(--nl-web-hover-bg);
	color: var(--nl-web-text-primary);
}

.centered-send-button:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.centered-send-button svg {
	width: 18px;
	height: 18px;
}

/* Responsive overrides */
@media (max-width: 768px) {
	.messages-container,
	.chat-input-wrapper {
		padding: 16px;
	}
}
